<% @page_title = @user.username %>

<% if logged_in? && @user.id == current_user.id %>
	<%= title(@user.username, "(this is you)")%>
<% else%>
	<%= title(@user.username)%>
<% end %>

<p class="microid-<%= microid(@user.email, user_url(@user)) %>"><%= @user.username %> has added <%= pluralize @user.recommendations.size, "recommendation" %> and <%= pluralize @user.taggings.size, "tag" %>.</p>

<%
@activities = []

@recommendations.each do |recommendation|
  
  @activities << [recommendation.created_at, "Added " + link_to(h(recommendation.name), recommendation_path(recommendation)) + " " + time_ago_in_words(recommendation.created_at) +  " ago."]

end

@descriptions.each do |description|

	@activities << [description.created_at, "Edited the description for " + link_to(h(description.recommendation.name), recommendation_path(description.recommendation)) + " " + time_ago_in_words(description.created_at) + " ago."]

 end 

@justifications.each do |justification|
	
  @activities << [justification.created_at, "Edited the justification for " + link_to(h(justification.recommendation.name), justification_recommendation_path(justification.recommendation)) + " " + time_ago_in_words(justification.created_at) + " ago."]

end

@taggings.each do |tagging|
	
	@activities << [tagging.created_at, "Tagged " + link_to( h(tagging.recommendation.name), recommendation_path(tagging.recommendation)) + " with " + tag_link(tagging) + " " + time_ago_in_words(tagging.created_at) + " ago."]

end

@activities.sort!
@activities.reverse!

%>



<ul class="recommendations">
	<% @activities.each do |activity| %>
	
		<li><%= activity[1] %></li>

	<% end%>


</ul>


<p>See <%= link_to "all users", users_path %>.</p>